Skip to content

1. Markov-decision-process

1. Preliminaries

(1) Counting Measure

We define the Counting Measure[1] in mathematics, the counting measure can be defined on any measurable space (for example, the set X on any Sigma-algebra, see Definition. sigma-algebra[2]), but it's often in a countable sets.

In combinatorics theory, we denote the ground set as X, then the ==sigma-algebra== Σ defined by such ground set X is given by :

(1.1.1)ΣP(X)

Where P(X), or 2X means the power set of X[3] (to be more clean, all of the subsets).

After that, the (X,Σ) forms a positive measure space Σ[0,+]. Then the counting measure is only σ-finite if and only if the space X is countable.

Then, the counting measure is the positive measure Σ[0,+], defined by :

(1.1.2)μ(A)={|A|ifA is a finite set+ifA is an infinite set

for all AΣ, where |A| is the cardinality(number of elements) of set A.

Notations We often use (X,Σ,μ) to denote a space. For this part, the first parameter is ground set, second is its subsets. Third (optional) is the measure.

(2) Integration on the counting measure

1. Discrete representation

We take the measure space (N,2N,μ), Take any measurable function f:N[0,+]. it can be ==represented pointwise== as follows :

(1.2.1)f(x)=f(1)+f(2)+f(n)++f()

then we got :

(1.2.2)f(x)=n=1f(n)1{n}(x)=limMn=1Mf(n)1{n}(x)ϕM(x)

where we represent the 1{n} as :

(1.2.3)1{n}(x)={1x= n0otherwise

Here, {n} means a singleton with element n, and each ϕM is measurable. apparently, ϕM+1(x)=ϕM+f(M+1)ϕM(x)

2. Integration of function over countable measure

From (1.2.2), we know a function f(x) can be represented with ϕM(x), i.e., :

(1.2.4)f(x)=limMϕM(x)ϕM(x)=n=1Mf(n)1{n}(x)

here, since μ is countable measure, we have μ({n})=1, so, for any measure μ on the space (X,Σ,μ) :

(1.2.5)NϕMdμ=n=1Mf(n)N1{n}(x)dμ=n=1Mf(n)μ({n})

So we have the integral over the countable measure is :

(1.2.6)Nf(x)dμ=n=1f(n)

We note that, this integration also defines a measure μ~ on (X,Σ) via :

(1.2.7)μ~(A):=aAf(a)AX

the μ~ is a new measure on A, with taking f(x)=1 gives counting measure.

(3) Concepts in the random, probabilistic process and RL

These concepts can be found in [4]

STATE : a numeric representation of what the agent is observing at a particular point of time in the environment ACTION : the input the agent provides to the environments, calculated by applying a policy to the current state REWARD : feedback signal from the environment reflecting how well the agent is performing the goals.

The goal is for the current state, choose optimal action to maximize the long-term expected reward provided by the environment.

Such conceptions is also very basic in the control systems, this is. Current State + Action determines the new state [5]

2. Markov-decision-process (MDP)

(1) Definition of MDP

The reinforced learning is a model for a system evolves as different actions applied to the system. For a Markov decision process (MDP)[6][7], that defined by the following 4-element tuple :

(2.1.1)MDP: (S,A,Pa,Ra)

This means : available state, available action, model decision and reward

We describe the Markov decision process as a 4-tuple process where :

  1. S is a set of states called state space
  2. A is a set of actions called action space, and As often refers to the set of actions available from state S.
  3. Pa is a intuitive level, or called Pa(s,s). For the action a in state s will lead to s at the time t+1. This is defined to satisfy following relation :
(2.1.2)Pr(st+1S|st=s,at=a)action determinedSPa(s,s)ds

Pr describes the ==probability that what probability the next state to reach, under certain state and actions==. This is integral for every SS measurable. 4. Ra is immediate reward, or expected immediate reward received after action a is taken. and such reward is a general random variable.

Pa(s,s) is the transition of the system Ra(s,s) often is 1 when the state after transition is correct.

(2) Simple example

A simple example is the robot navigation system (source: [8]):

robotics navigation system

robotics navigation system

For the above robotics navigation task shown in Fig. 2.1, we have :

  1. S is the set of states in the MDP, as the navigation gridworld shows.
  2. A is the actions that robot can take at each state, e.g., “go forward”, “turn right”, “turn left”, “stay at the same location”.
  3. If we don't know that the robot moves exactly but only up to some approximation, this amounts to defining a transition function that from current state s to a new state s.
(2.2.1)T:S×A×S[0,1]

such that it's condition probability (here for example forwardT=0.8, turn rightT=0.1, so we said [0,1])

(2.2.2)T(s,a,s)=P(s|s,a)

And the transition function is a probability distribution that sST(s,a,s)=1 for all sS and aA. So in many cases, like (2.1.1), we use P instead of T here.

We can construct a notion using the concept of reward r:S×AR, we can say that the robot gets a reward r(s,a) if robot takes an action a at state s. Such reward is designed by the user.

(3) Return Factor and Discount Factor

For the MDP in (2.1.1), the continues taking actions to result in a trajectory :

(2.3.1)τ=(s0,a0,r0,s1,a1,r1,)

For each time step t, the robot is at state st, then we define the return of the trajectory as :

(2.3.2)R(τ)=r0+r1+r2+

The goal is to reach the final state that scores as fast as possible, if we scores at time t, the reward Ra. But if the wanted state is reached at t+1, we set the reward as γRa , we also introduce the discount factor γ, which is often defined by the discount rate r :

(2.3.3)γ=11+r

A lower discount factor makes the decision maker more short-sighted (greedy for recent best solutions). Then the discounted return, or "reward" here, such reward is defined as :

(2.3.4)R(τ)=t=0γtRat

And for a large value of the discount factor, e.g. γ=0.99, then robot is encouraged to explore more and find the best trajectory. A successful value often between γ[0.9,0.99]

(4) Optimization Policy & Objective definition

The reinforcement learning problem is typically modeled using Markov Decision Processes. We consider that we want the reach a specific final goal. So we determine state of the result as π(x) by a given policy. The objective as to maximize the cumulative function of the random rewards :

(2.4.1)η(π)=E[t=0γtRat(st,st+1)]

where at=π(st), or Actions at each time step is defined given by the policy.

We note another objective function to use is the H, or the step return;

(2.4.2)E[t=0H1Rat(st,st+1)]

3. Bellman Optimality Equation

(1) For a determined-state problem

Firstly, we represent :

  1. policy value function as Vπ(s)
  2. Optimal value function as V(s) (We want to make policy function to approach this)

Bellman Equation[9] helps evaluate the expected reward relative to the advantage or disadvantage of each state. the Value function is defined as :

(3.1.1)V(s)=maxa[R(s)+γV(s)]

here, R is period-specific objective function, V(s) is the future objective function.

Sometimes, if R is related with a we use :

V(s)=maxa[R(s,a)+γV(s)]

Bellman showed that a dynamic optimization problem in discrete time can be stated in a recursive, step-by-step form known as backward induction by writing down the relationship between the value function in one period and the value function in the next period.

Here, maxa means the choice of the best possible action. This means, to choose the best possible action, the value is the current response + weighted value of future possible states. For a more general equation, we still need to consider the probability of next option. i.e. adding P(s|s) into (3.1.1) :

(3.1.2)V(s)=maxa|R(s)+γsP(s|s,a)V(s)|

We note in application case, we use (3.1.1) more than (3.1.2)

The often the ideal action is to take the reward from the end state back to the start, which means, the end state has been defined (as π later). A comprehensive picture is drawn as follows (the V is calculated by ):

394

The action is to bring us to the highest value function. So it's very easy to find the clean path.

(2) For A stochastic system

For example, a consumer with initial wealth endowment s0, he also have instantaneous utility function u(c) (this will determine the objective depends by the consumption, so this is deemed as "reward"), discounts the next period utility at a rate of β, and c here denotes the consumption. We should choose a consumption plan, then the current interest rate on the left money in the bank is r.

So the consumer should choose a sequence {ct}  such a way that their lifetime expected utility is maximized, so we often use following function :

(3.2.1)max{ct}t=0t=0βtu(ct)

Then the constraint is :

(3.2.2)st+1=(1+r)(stct)ct>0limtat0

the value function should be :

(3.2.3)V(s)=max0ca{u(c)+βV((1+r)(stc))}

References


  1. https://en.wikipedia.org/wiki/Counting_measure ↩︎

  2. 1. Sigma-algebra and Lebesgue measure ↩︎

  3. https://en.wikipedia.org/wiki/Power_set ↩︎

  4. https://www.youtube.com/watch?v=14BfO5lMiuk ↩︎

  5. https://en.wikipedia.org/wiki/Optimal_control ↩︎

  6. https://en.wikipedia.org/wiki/Markov_decision_process ↩︎

  7. https://d2l.ai/chapter_reinforcement-learning/mdp.html ↩︎

  8. https://d2l.ai/chapter_reinforcement-learning/mdp.html ↩︎

  9. https://en.wikipedia.org/wiki/Bellman_equation ↩︎